﻿////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// <copyright>Copyright 2008-2011 Andreas Huber Doenni</copyright>
// Distributed under the Microsoft Public License (Ms-PL).
// See accompanying file License.txt or copy at http://mews.codeplex.com/license.
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

namespace Mews.Net.Nntp
{
    /// <summary>Represents a CAPABILITIES command to be sent to an NNTP server, see
    /// <a href="http://www.ietf.org/rfc/rfc3977.txt">RFC 3977</a> 5.2.</summary>
    /// <threadsafety static="true" instance="false"/>
    public sealed class CapabilitiesCommand : SingleLineCommand<CapabilitiesResponse>
    {
        private static readonly string[] successResponseCodes = { "101" };

        /// <summary>Initializes a new instance of the <see cref="CapabilitiesCommand"/> class.</summary>
        public CapabilitiesCommand() : base("CAPABILITIES", 2, successResponseCodes)
        {
        }

        ////////////////////////////////////////////////////////////////////////////////////////////////////////////////

        /// <summary>See <see cref="SingleLineCommandBase{T, U}.CreateResponse"/>.</summary>
        protected sealed override CapabilitiesResponse CreateResponse(ResponseStream responseStream)
        {
            return new CapabilitiesResponse(responseStream);
        }
    }
}
